﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterALSafa.Master" AutoEventWireup="true"
    CodeBehind="TE_Student_Topic.aspx.cs" Inherits="School.Pages.Teaching.TE_Student_Topic" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.prettyPhoto.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        var refresh = true;
        $(document).ready(function () {
            $(".Grid a[rel^='prettyphoto']").prettyPhoto({
                theme: 'facebook',
                default_width: 850,
                default_height: 450,
                allowresize: false,
                callback: function () { if (refresh) $(".btnSearch").click(); else refresh = true; }
            });
        });
        function closeMe() {
            refresh = true;
            $.prettyPhoto.close();
        }
        $(function () { $(".grid tr").hover(function () { $(this).toggleClass("highlight"); }) });
    </script>
    <script language="javascript" type="text/javascript">
        function CheckOtherIsCheckedByGVID(spanChk) {
            var IsChecked = spanChk.checked;
            if (IsChecked) {
                spanChk.parentElement.parentElement.style.backgroundColor = '#228b22';  // grdEmployees.SelectedItemStyle.BackColor
                spanChk.parentElement.parentElement.style.color = 'white'; // grdEmployees.SelectedItemStyle.ForeColor
            }
            //ContentPlaceHolder1_gvBank_A
            var CurrentRdbID = spanChk.id;
            var Chk = spanChk;
            //Parent = Chk.form.elements;	
            Parent = document.getElementById('ContentPlaceHolder1_gvBank_A');
            //alert(Parent.rows.length)
            var items = Parent.getElementsByTagName('input');

            for (i = 0; i < items.length; i++) {
                if (items[i].id != CurrentRdbID && items[i].type == "radio") {
                    if (items[i].checked) {
                        items[i].checked = false;
                        items[i].parentElement.parentElement.style.backgroundColor = 'white'; //grdEmployees.ItemStyle.BackColor
                        items[i].parentElement.parentElement.style.color = 'black'; //grdEmployees.ItemStyle.ForeColor
                    }
                }
            }
        }
    </script>
    <div>
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
        </div>
        <div>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <div>
                        <div style="float: right">
                            المواد
                        </div>
                        <div style="float: right; padding: 0px 5px">
                            <asp:DropDownList ID="ddlSubjects" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                                DataTextField="Subject_Name" DataValueField="Id" OnSelectedIndexChanged="ddlSubjects_SelectedIndexChanged"
                                Width="150px">
                                <asp:ListItem Value="0">اختيار</asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="ddlSubjects"
                                Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st">*</asp:RequiredFieldValidator>
                        </div>
                        <div style="float: right">
                            الوحدة
                        </div>
                        <div style="float: right; padding: 0px 5px">
                            <asp:DropDownList ID="ddlCourse" runat="server" AppendDataBoundItems="True" DataTextField="Course_Name"
                                DataValueField="Id" Width="150px">
                                <asp:ListItem Value="0">اختيار</asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" ControlToValidate="ddlCourse"
                                Display="Dynamic" ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="st"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
        <div>
            <asp:Button ID="btnsearch" runat="server" CssClass="graybutton btnSearch" OnClick="btnsearch_Click"
                Text="عرض" ValidationGroup="st" />
        </div>
        <div style="padding: 20px 10px">
            <asp:GridView ID="gvBank_Qin" runat="server" AllowPaging="True" AlternatingRowStyle-CssClass="GridItemAltername"
                AutoGenerateColumns="False" CssClass="Grid" DataKeyNames="Id" FooterStyle-CssClass="GridHeaderFooter"
                HeaderStyle-CssClass="GridHeaderFooter" PagerStyle-CssClass="GridPager" Width="80%"
                OnPageIndexChanging="gvBank_Qin_PageIndexChanging">
                <AlternatingRowStyle CssClass="GridItemAltername" />
                <Columns>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            م
                        </HeaderTemplate>
                        <ItemTemplate>
                            <%# Container.DataItemIndex + 1 %>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="الــدرس" SortExpression="Topic_Name">
                        <EditItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("Topic_Name") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <a rel="prettyPhoto[iframe]" href='<%#Eval("Id","TE_Topic_Content.aspx?id={0}&iframe=true")%>'>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("Topic_Name") %>'></asp:Label>
                            </a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="تماريــــــــن">
                        <ItemTemplate>
                            <asp:HyperLink ID="hpDisplay" runat="server" rel="prettyPhoto[iframe]" NavigateUrl='<%#Eval("Id","TE_Student_Question.aspx?id={0}&iframe=true")%>'>استعراض</asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle CssClass="GridHeaderFooter" />
                <HeaderStyle CssClass="GridHeaderFooter" />
                <PagerStyle CssClass="GridPager" />
            </asp:GridView>
        </div>
    </div>
</asp:Content>
